import Vue from 'vue';
import Vuex from 'vuex';

import user from './modules/user';
import message from './modules/message';

Vue.use(Vuex);

const store = new Vuex.Store({
	state: {
		queueNum: 0,
		currentPosition: 0,
		sessionId: null,
		formId: '',
		showGuideBox: false, //引导框视图
		showIM: false, //IM视图
		pdffile: null, //pdfUrl
		camera: '' //摄像头正反
	},
	getters: {
		//计算属性 $store.getters.属性名
	},
	mutations: {
		setQueueNum(state, value) {
			return (state.queueNum = value);
		},
		setCurrentPosition(state, value) {
			return (state.currentPosition = value);
		},
		setSessionId(state, value) {
			return (state.sessionId = value);
		},
		setShowGuideBox(state, value) {
			return (state.showGuideBox = value);
		},
		setShowIM(state, value) {
			return (state.showIM = value);
		},
		setPdfFile(state, value) {
			return (state.pdffile = value);
		},
		setCamera(state, value) {
			return (state.camera = value);
		}
	},
	actions: {},
	modules: {
		user,
		message
	}
});

window.store = store;

export default store;
